package ${t.packagePath}.model.export;

import java.io.Serializable;
<#if t.hasFo("date", "date-create", "date-update") >import java.util.*;
</#if>
<#if cfg.mybatisPlus>
import com.baomidou.mybatisplus.annotation.*;
import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.SearchBean;
import java.util.Date;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
</#if>

import lombok.Data;
import io.swagger.annotations.ApiModelProperty;

/**
 * Model: ${t.tableName} -- ${t.tableComment}
 * 此模型实体单独作用于EasyPoi的Excel导出。不得作为他用。其他人不得引用。
 * @author ${cfg.author}
 */
@Data
@SearchBean(tables ="${t.tableName} t1",joinCond = "1=1")
public class ${t.modelName}Export implements Serializable {


	// ---------- 表中字段 ----------
<#list t.t1List as c>
<#if cfg.modelDocWay = 2 || cfg.modelDocWay = 3>${cfg.getStarDoc(c.columnComment)}</#if>
	@ApiModelProperty(value = "${c.columnComment}")
	@Excel(name = "${c.columnComment}")
<#if cfg.mybatisPlus && t.primaryKey.columnName == c.columnName>	@TableId(type = IdType.AUTO)${cfg.line}</#if><#rt>
<#if cfg.mybatisPlus && c.fieldType == 'Date'>	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")${cfg.line}</#if><#rt>
	@DbField("t1.${c.columnName}")
	${cfg.modelVisitWayString} ${c.fieldType} ${c.fieldName};	<#if cfg.modelDocWay == 1>	 </#if><#if cfg.modelAddLine = 1>${cfg.line}</#if>
</#list>

<#if t.t23List?size != 0 || t.hasFt('tree-lazy')>
	// ---------- 额外字段 ----------
<#list t.t23List as c>
<#if cfg.modelDocWay = 2 || cfg.modelDocWay = 3 >${cfg.getStarDoc(c.tx.comment)}</#if>
	${cfg.modelVisitWayString} ${c.getJavaType()} ${c.fieldName};	<#if cfg.modelDocWay == 1>	// 外键: ${c.tx.comment} </#if><#if cfg.modelAddLine = 1>${cfg.line}</#if>
</#list>
</#if>
<#if t.hasFt('tree-lazy')>
<#if cfg.modelDocWay = 2 || cfg.modelDocWay = 3>${cfg.getStarDoc('是否包含子节点')}</#if>
	public Boolean getHasChildren() {
		return ${t.getDbColumnByFalg('tree-lazy-children-count').fieldName} > 0;
	}
</#if>
}
